Optimal. Leaf size=242 \[ -\frac{a^2 \left (-44 c^2 d^2-10 c^3 d+c^4-40 c d^3-12 d^4\right ) \tan (e+f x)}{10 d f}+\frac{3 a^2 (2 c+d) \left (2 c^2+3 c d+2 d^2\right ) \tanh ^{-1}(\sin (e+f x))}{8 f}-\frac{a^2 \left (c^2-10 c d-12 d^2\right ) \tan (e+f x) (c+d \sec (e+f x))^2}{20 d f}-\frac{a^2 \left (-20 c^2 d+2 c^3-57 c d^2-30 d^3\right ) \tan (e+f x) \sec (e+f x)}{40 f}+\frac{a^2 \tan (e+f x) (c+d \sec (e+f x))^4}{5 d f}-\frac{a^2 (c-10 d) \tan (e+f x) (c+d \sec (e+f x))^3}{20 d f} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.342701, antiderivative size = 277, normalized size of antiderivative = 1.14, number of steps used = 8, number of rules used = 7, integrand size = 31, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.226, Rules used = {3987, 100, 147, 50, 63, 217, 203} \[ \frac{3 a^2 (2 c+d) \left (2 c^2+3 c d+2 d^2\right ) \tan (e+f x)}{8 f}+\frac{3 a^3 (2 c+d) \left (2 c^2+3 c d+2 d^2\right ) \tan (e+f x) \tan ^{-1}\left (\frac{\sqrt{a-a \sec (e+f x)}}{\sqrt{a (\sec (e+f x)+1)}}\right )}{4 f \sqrt{a-a \sec (e+f x)} \sqrt{a \sec (e+f x)+a}}+\frac{(2 c+d) \left (2 c^2+3 c d+2 d^2\right ) \tan (e+f x) \left (a^2 \sec (e+f x)+a^2\right )}{8 f}+\frac{d \tan (e+f x) (a \sec (e+f x)+a)^2 \left (2 \left (8 c^2+5 c d+2 d^2\right )+d (7 c+2 d) \sec (e+f x)\right )}{20 f}+\frac{d \tan (e+f x) (a \sec (e+f x)+a)^2 (c+d \sec (e+f x))^2}{5 f} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 3987
Rule 100
Rule 147
Rule 50
Rule 63
Rule 217
Rule 203
Rubi steps
\begin{align*} \int \sec (e+f x) (a+a \sec (e+f x))^2 (c+d \sec (e+f x))^3 \, dx &=-\frac{\left (a^2 \tan (e+f x)\right ) \operatorname{Subst}\left (\int \frac{(a+a x)^{3/2} (c+d x)^3}{\sqrt{a-a x}} \, dx,x,\sec (e+f x)\right )}{f \sqrt{a-a \sec (e+f x)} \sqrt{a+a \sec (e+f x)}}\\ &=\frac{d (a+a \sec (e+f x))^2 (c+d \sec (e+f x))^2 \tan (e+f x)}{5 f}+\frac{\tan (e+f x) \operatorname{Subst}\left (\int \frac{(a+a x)^{3/2} (c+d x) \left (-a^2 \left (5 c^2+2 c d+2 d^2\right )-a^2 d (7 c+2 d) x\right )}{\sqrt{a-a x}} \, dx,x,\sec (e+f x)\right )}{5 f \sqrt{a-a \sec (e+f x)} \sqrt{a+a \sec (e+f x)}}\\ &=\frac{d (a+a \sec (e+f x))^2 (c+d \sec (e+f x))^2 \tan (e+f x)}{5 f}+\frac{d (a+a \sec (e+f x))^2 \left (2 \left (8 c^2+5 c d+2 d^2\right )+d (7 c+2 d) \sec (e+f x)\right ) \tan (e+f x)}{20 f}-\frac{\left (a^2 (2 c+d) \left (2 c^2+3 c d+2 d^2\right ) \tan (e+f x)\right ) \operatorname{Subst}\left (\int \frac{(a+a x)^{3/2}}{\sqrt{a-a x}} \, dx,x,\sec (e+f x)\right )}{4 f \sqrt{a-a \sec (e+f x)} \sqrt{a+a \sec (e+f x)}}\\ &=\frac{(2 c+d) \left (2 c^2+3 c d+2 d^2\right ) \left (a^2+a^2 \sec (e+f x)\right ) \tan (e+f x)}{8 f}+\frac{d (a+a \sec (e+f x))^2 (c+d \sec (e+f x))^2 \tan (e+f x)}{5 f}+\frac{d (a+a \sec (e+f x))^2 \left (2 \left (8 c^2+5 c d+2 d^2\right )+d (7 c+2 d) \sec (e+f x)\right ) \tan (e+f x)}{20 f}-\frac{\left (3 a^3 (2 c+d) \left (2 c^2+3 c d+2 d^2\right ) \tan (e+f x)\right ) \operatorname{Subst}\left (\int \frac{\sqrt{a+a x}}{\sqrt{a-a x}} \, dx,x,\sec (e+f x)\right )}{8 f \sqrt{a-a \sec (e+f x)} \sqrt{a+a \sec (e+f x)}}\\ &=\frac{3 a^2 (2 c+d) \left (2 c^2+3 c d+2 d^2\right ) \tan (e+f x)}{8 f}+\frac{(2 c+d) \left (2 c^2+3 c d+2 d^2\right ) \left (a^2+a^2 \sec (e+f x)\right ) \tan (e+f x)}{8 f}+\frac{d (a+a \sec (e+f x))^2 (c+d \sec (e+f x))^2 \tan (e+f x)}{5 f}+\frac{d (a+a \sec (e+f x))^2 \left (2 \left (8 c^2+5 c d+2 d^2\right )+d (7 c+2 d) \sec (e+f x)\right ) \tan (e+f x)}{20 f}-\frac{\left (3 a^4 (2 c+d) \left (2 c^2+3 c d+2 d^2\right ) \tan (e+f x)\right ) \operatorname{Subst}\left (\int \frac{1}{\sqrt{a-a x} \sqrt{a+a x}} \, dx,x,\sec (e+f x)\right )}{8 f \sqrt{a-a \sec (e+f x)} \sqrt{a+a \sec (e+f x)}}\\ &=\frac{3 a^2 (2 c+d) \left (2 c^2+3 c d+2 d^2\right ) \tan (e+f x)}{8 f}+\frac{(2 c+d) \left (2 c^2+3 c d+2 d^2\right ) \left (a^2+a^2 \sec (e+f x)\right ) \tan (e+f x)}{8 f}+\frac{d (a+a \sec (e+f x))^2 (c+d \sec (e+f x))^2 \tan (e+f x)}{5 f}+\frac{d (a+a \sec (e+f x))^2 \left (2 \left (8 c^2+5 c d+2 d^2\right )+d (7 c+2 d) \sec (e+f x)\right ) \tan (e+f x)}{20 f}+\frac{\left (3 a^3 (2 c+d) \left (2 c^2+3 c d+2 d^2\right ) \tan (e+f x)\right ) \operatorname{Subst}\left (\int \frac{1}{\sqrt{2 a-x^2}} \, dx,x,\sqrt{a-a \sec (e+f x)}\right )}{4 f \sqrt{a-a \sec (e+f x)} \sqrt{a+a \sec (e+f x)}}\\ &=\frac{3 a^2 (2 c+d) \left (2 c^2+3 c d+2 d^2\right ) \tan (e+f x)}{8 f}+\frac{(2 c+d) \left (2 c^2+3 c d+2 d^2\right ) \left (a^2+a^2 \sec (e+f x)\right ) \tan (e+f x)}{8 f}+\frac{d (a+a \sec (e+f x))^2 (c+d \sec (e+f x))^2 \tan (e+f x)}{5 f}+\frac{d (a+a \sec (e+f x))^2 \left (2 \left (8 c^2+5 c d+2 d^2\right )+d (7 c+2 d) \sec (e+f x)\right ) \tan (e+f x)}{20 f}+\frac{\left (3 a^3 (2 c+d) \left (2 c^2+3 c d+2 d^2\right ) \tan (e+f x)\right ) \operatorname{Subst}\left (\int \frac{1}{1+x^2} \, dx,x,\frac{\sqrt{a-a \sec (e+f x)}}{\sqrt{a+a \sec (e+f x)}}\right )}{4 f \sqrt{a-a \sec (e+f x)} \sqrt{a+a \sec (e+f x)}}\\ &=\frac{3 a^2 (2 c+d) \left (2 c^2+3 c d+2 d^2\right ) \tan (e+f x)}{8 f}+\frac{3 a^3 (2 c+d) \left (2 c^2+3 c d+2 d^2\right ) \tan ^{-1}\left (\frac{\sqrt{a-a \sec (e+f x)}}{\sqrt{a+a \sec (e+f x)}}\right ) \tan (e+f x)}{4 f \sqrt{a-a \sec (e+f x)} \sqrt{a+a \sec (e+f x)}}+\frac{(2 c+d) \left (2 c^2+3 c d+2 d^2\right ) \left (a^2+a^2 \sec (e+f x)\right ) \tan (e+f x)}{8 f}+\frac{d (a+a \sec (e+f x))^2 (c+d \sec (e+f x))^2 \tan (e+f x)}{5 f}+\frac{d (a+a \sec (e+f x))^2 \left (2 \left (8 c^2+5 c d+2 d^2\right )+d (7 c+2 d) \sec (e+f x)\right ) \tan (e+f x)}{20 f}\\ \end{align*}
Mathematica [A] time = 1.45491, size = 326, normalized size = 1.35 \[ -\frac{a^2 (\cos (e+f x)+1)^2 \sec ^4\left (\frac{1}{2} (e+f x)\right ) \sec ^5(e+f x) \left (120 \left (8 c^2 d+4 c^3+7 c d^2+2 d^3\right ) \cos ^5(e+f x) \left (\log \left (\cos \left (\frac{1}{2} (e+f x)\right )-\sin \left (\frac{1}{2} (e+f x)\right )\right )-\log \left (\sin \left (\frac{1}{2} (e+f x)\right )+\cos \left (\frac{1}{2} (e+f x)\right )\right )\right )-2 \sin (e+f x) \left (5 \left (72 c^2 d+12 c^3+87 c d^2+34 d^3\right ) \cos (e+f x)+16 \left (30 c^2 d+10 c^3+30 c d^2+9 d^3\right ) \cos (2 (e+f x))+120 c^2 d \cos (3 (e+f x))+100 c^2 d \cos (4 (e+f x))+380 c^2 d+20 c^3 \cos (3 (e+f x))+40 c^3 \cos (4 (e+f x))+120 c^3+105 c d^2 \cos (3 (e+f x))+80 c d^2 \cos (4 (e+f x))+400 c d^2+30 d^3 \cos (3 (e+f x))+24 d^3 \cos (4 (e+f x))+152 d^3\right )\right )}{1280 f} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A] time = 0.063, size = 420, normalized size = 1.7 \begin{align*}{\frac{3\,{a}^{2}{c}^{3}\ln \left ( \sec \left ( fx+e \right ) +\tan \left ( fx+e \right ) \right ) }{2\,f}}+5\,{\frac{{a}^{2}{c}^{2}d\tan \left ( fx+e \right ) }{f}}+{\frac{21\,{a}^{2}{d}^{2}c\sec \left ( fx+e \right ) \tan \left ( fx+e \right ) }{8\,f}}+{\frac{21\,{a}^{2}{d}^{2}c\ln \left ( \sec \left ( fx+e \right ) +\tan \left ( fx+e \right ) \right ) }{8\,f}}+{\frac{6\,{a}^{2}{d}^{3}\tan \left ( fx+e \right ) }{5\,f}}+{\frac{3\,{a}^{2}{d}^{3}\tan \left ( fx+e \right ) \left ( \sec \left ( fx+e \right ) \right ) ^{2}}{5\,f}}+2\,{\frac{{a}^{2}{c}^{3}\tan \left ( fx+e \right ) }{f}}+3\,{\frac{{a}^{2}{c}^{2}d\sec \left ( fx+e \right ) \tan \left ( fx+e \right ) }{f}}+3\,{\frac{{a}^{2}{c}^{2}d\ln \left ( \sec \left ( fx+e \right ) +\tan \left ( fx+e \right ) \right ) }{f}}+4\,{\frac{{a}^{2}{d}^{2}c\tan \left ( fx+e \right ) }{f}}+2\,{\frac{{a}^{2}{d}^{2}c\tan \left ( fx+e \right ) \left ( \sec \left ( fx+e \right ) \right ) ^{2}}{f}}+{\frac{{a}^{2}{d}^{3}\tan \left ( fx+e \right ) \left ( \sec \left ( fx+e \right ) \right ) ^{3}}{2\,f}}+{\frac{3\,{a}^{2}{d}^{3}\sec \left ( fx+e \right ) \tan \left ( fx+e \right ) }{4\,f}}+{\frac{3\,{a}^{2}{d}^{3}\ln \left ( \sec \left ( fx+e \right ) +\tan \left ( fx+e \right ) \right ) }{4\,f}}+{\frac{{a}^{2}{c}^{3}\sec \left ( fx+e \right ) \tan \left ( fx+e \right ) }{2\,f}}+{\frac{{a}^{2}{c}^{2}d\tan \left ( fx+e \right ) \left ( \sec \left ( fx+e \right ) \right ) ^{2}}{f}}+{\frac{3\,{a}^{2}{d}^{2}c\tan \left ( fx+e \right ) \left ( \sec \left ( fx+e \right ) \right ) ^{3}}{4\,f}}+{\frac{{a}^{2}{d}^{3}\tan \left ( fx+e \right ) \left ( \sec \left ( fx+e \right ) \right ) ^{4}}{5\,f}} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [B] time = 0.988417, size = 633, normalized size = 2.62 \begin{align*} \frac{240 \,{\left (\tan \left (f x + e\right )^{3} + 3 \, \tan \left (f x + e\right )\right )} a^{2} c^{2} d + 480 \,{\left (\tan \left (f x + e\right )^{3} + 3 \, \tan \left (f x + e\right )\right )} a^{2} c d^{2} + 16 \,{\left (3 \, \tan \left (f x + e\right )^{5} + 10 \, \tan \left (f x + e\right )^{3} + 15 \, \tan \left (f x + e\right )\right )} a^{2} d^{3} + 80 \,{\left (\tan \left (f x + e\right )^{3} + 3 \, \tan \left (f x + e\right )\right )} a^{2} d^{3} - 45 \, a^{2} c d^{2}{\left (\frac{2 \,{\left (3 \, \sin \left (f x + e\right )^{3} - 5 \, \sin \left (f x + e\right )\right )}}{\sin \left (f x + e\right )^{4} - 2 \, \sin \left (f x + e\right )^{2} + 1} - 3 \, \log \left (\sin \left (f x + e\right ) + 1\right ) + 3 \, \log \left (\sin \left (f x + e\right ) - 1\right )\right )} - 30 \, a^{2} d^{3}{\left (\frac{2 \,{\left (3 \, \sin \left (f x + e\right )^{3} - 5 \, \sin \left (f x + e\right )\right )}}{\sin \left (f x + e\right )^{4} - 2 \, \sin \left (f x + e\right )^{2} + 1} - 3 \, \log \left (\sin \left (f x + e\right ) + 1\right ) + 3 \, \log \left (\sin \left (f x + e\right ) - 1\right )\right )} - 60 \, a^{2} c^{3}{\left (\frac{2 \, \sin \left (f x + e\right )}{\sin \left (f x + e\right )^{2} - 1} - \log \left (\sin \left (f x + e\right ) + 1\right ) + \log \left (\sin \left (f x + e\right ) - 1\right )\right )} - 360 \, a^{2} c^{2} d{\left (\frac{2 \, \sin \left (f x + e\right )}{\sin \left (f x + e\right )^{2} - 1} - \log \left (\sin \left (f x + e\right ) + 1\right ) + \log \left (\sin \left (f x + e\right ) - 1\right )\right )} - 180 \, a^{2} c d^{2}{\left (\frac{2 \, \sin \left (f x + e\right )}{\sin \left (f x + e\right )^{2} - 1} - \log \left (\sin \left (f x + e\right ) + 1\right ) + \log \left (\sin \left (f x + e\right ) - 1\right )\right )} + 240 \, a^{2} c^{3} \log \left (\sec \left (f x + e\right ) + \tan \left (f x + e\right )\right ) + 480 \, a^{2} c^{3} \tan \left (f x + e\right ) + 720 \, a^{2} c^{2} d \tan \left (f x + e\right )}{240 \, f} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A] time = 0.530885, size = 667, normalized size = 2.76 \begin{align*} \frac{15 \,{\left (4 \, a^{2} c^{3} + 8 \, a^{2} c^{2} d + 7 \, a^{2} c d^{2} + 2 \, a^{2} d^{3}\right )} \cos \left (f x + e\right )^{5} \log \left (\sin \left (f x + e\right ) + 1\right ) - 15 \,{\left (4 \, a^{2} c^{3} + 8 \, a^{2} c^{2} d + 7 \, a^{2} c d^{2} + 2 \, a^{2} d^{3}\right )} \cos \left (f x + e\right )^{5} \log \left (-\sin \left (f x + e\right ) + 1\right ) + 2 \,{\left (8 \, a^{2} d^{3} + 8 \,{\left (10 \, a^{2} c^{3} + 25 \, a^{2} c^{2} d + 20 \, a^{2} c d^{2} + 6 \, a^{2} d^{3}\right )} \cos \left (f x + e\right )^{4} + 5 \,{\left (4 \, a^{2} c^{3} + 24 \, a^{2} c^{2} d + 21 \, a^{2} c d^{2} + 6 \, a^{2} d^{3}\right )} \cos \left (f x + e\right )^{3} + 8 \,{\left (5 \, a^{2} c^{2} d + 10 \, a^{2} c d^{2} + 3 \, a^{2} d^{3}\right )} \cos \left (f x + e\right )^{2} + 10 \,{\left (3 \, a^{2} c d^{2} + 2 \, a^{2} d^{3}\right )} \cos \left (f x + e\right )\right )} \sin \left (f x + e\right )}{80 \, f \cos \left (f x + e\right )^{5}} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F] time = 0., size = 0, normalized size = 0. \begin{align*} a^{2} \left (\int c^{3} \sec{\left (e + f x \right )}\, dx + \int 2 c^{3} \sec ^{2}{\left (e + f x \right )}\, dx + \int c^{3} \sec ^{3}{\left (e + f x \right )}\, dx + \int d^{3} \sec ^{4}{\left (e + f x \right )}\, dx + \int 2 d^{3} \sec ^{5}{\left (e + f x \right )}\, dx + \int d^{3} \sec ^{6}{\left (e + f x \right )}\, dx + \int 3 c d^{2} \sec ^{3}{\left (e + f x \right )}\, dx + \int 6 c d^{2} \sec ^{4}{\left (e + f x \right )}\, dx + \int 3 c d^{2} \sec ^{5}{\left (e + f x \right )}\, dx + \int 3 c^{2} d \sec ^{2}{\left (e + f x \right )}\, dx + \int 6 c^{2} d \sec ^{3}{\left (e + f x \right )}\, dx + \int 3 c^{2} d \sec ^{4}{\left (e + f x \right )}\, dx\right ) \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [B] time = 1.47218, size = 714, normalized size = 2.95 \begin{align*} \text{result too large to display} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]